package com.classtest.test2;

public class Circle {
    private double radius;//半径

    public Circle() {
    }

    public Circle(double r) {
        this.radius = r;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    //获取圆的面积
    public double getArea(double r) {
        return r * r * Math.PI;
    }

    //获取圆的周长
    public double getPerimeter(double r) {
        return 2 * r * Math.PI;
    }

    //输出信息
    public void show(double r) {
        System.out.println("半径为：" + r);
        System.out.println("周长为：" + getArea(r));
        System.out.println("面积为：" + getPerimeter(r));
    }
}
